<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>03parentchildcomponent</title>
    <script type="text/javascript" src="../js/vue.js"></script>
    <style>
        .div1{
            width: 300px;
            height: 240px;
            border: 1px dotted;
            text-align: center;
            background-color: honeydew;
            border-radius: 20px;
            float: left;
            margin: 10px;
        }
    </style>
</head>
<body>
    <div id="app" style="padding-left: 25px;">
        <lessonlist></lessonlist>
        <lessonlist></lessonlist>
    </div>
    <template id="templateitem">
        <div class="div1">
            <div style="margin-top: 10px;">
                <img src="../images/model6.jpg" alt="" width="270px" height="150px" style="border-radius: 10px;">
            </div>
            <div style="font-size: 20px;font-weight: bold;">java基础</div>
            <div style="margin-top:15px;">
                <div style="float:left;margin-left: 15px;">1234人学习|1234评论</div>
                <div style="float:right;margin-right: 15px;">
                    <button style="background-color: green;color: white;">免费</button>
                </div>
            </div>
        </div>
    </template>
    <template id="templateList">
        <div>
            <lessonitem></lessonitem>
            <lessonitem></lessonitem>
            <lessonitem></lessonitem>
            <lessonitem></lessonitem>
            <lessonitem></lessonitem>
            <lessonitem></lessonitem>
            <lessonitem></lessonitem>
            <lessonitem></lessonitem>
        </div>
    </template>
</body>
</html>
<script>
    var vm=new Vue({
        el:'#app',
        components:{
            'lessonlist':{
                template:'#templateList',
                components:{
                    'lessonitem':{
                        template:'#templateitem'
                    }
                }
            }
        }
    });
</script>